package editStudentGui;

import group.Group;
import role.Role;
import student.Student;

public class EditStudentTableContent
{
	private boolean firstChoose = false;
	private boolean secondChoose = false;
	private Student student;
	private Role role;
	private Group group;

	public EditStudentTableContent(Group group, Role role, Student student)
	{
		this.setGroup(group);
		this.setRole(role);
		this.setStudent(student);
	}

	public Student getStudent()
	{
		return student;
	}

	public void setStudent(Student student)
	{
		this.student = student;
	}

	public Role getRole()
	{
		return role;
	}

	public void setRole(Role role)
	{
		this.role = role;
	}

	public Group getGroup()
	{
		return group;
	}

	public void setGroup(Group group)
	{
		this.group = group;
	}

	public Object getValue(int index)
	{
		switch (index)
		{
		case 0:
			return this.getFirstChoose();
		case 1:
			return this.getSecondChoose();
		case 2:
			return this.getStudent().getFirstName();
		case 3:
			return this.getStudent().getLastName();
		case 4:
			return this.getStudent().getMatrNr();
		case 5:
			return this.getStudent().getBranch();
		case 6:
			return this.getStudent().getMail();
		case 7:
			return this.getRole().getName();
		case 8:
			return this.getGroup().getName();
		}
		return null;
	}

	public void setValue(int index, Object value)
	{
		switch (index)
		{
		case 0:
			this.setFirstChoose((Boolean) value);
			return;
		case 1:
			this.setSecondChoose((Boolean) value);
			return;
		case 2:
			this.student.setFirstName((String) value);
			return;
		case 3:
			this.student.setLastName((String) value);
			return;
		case 4:
			this.student.setMatrNr(Integer.parseInt((String) value));
			return;
		case 5:
			this.student.setBranch((String) value);
			return;
		case 6:
			this.student.setMail((String) value);
			return;
		}
	}

	public boolean getFirstChoose()
	{
		return firstChoose;
	}

	public void setFirstChoose(boolean firstChoose)
	{
		this.firstChoose = firstChoose;
	}

	public boolean getSecondChoose()
	{
		return secondChoose;
	}

	public void setSecondChoose(boolean secondChoose)
	{
		this.secondChoose = secondChoose;
	}

}
